# -*- coding: utf-8 -*-


def bubble_sort(array):
    """冒泡排序"""
    for i in range(1, len(array)):
        for j in range(0, len(array) - i):
            if array[j] > array[j + 1]:  # 从小到大排序
                array[j], array[j + 1] = array[j + 1], array[j]
                pass
            pass
        pass
    return array


if __name__ == '__main__':
    unsort_array = [32, 65, 13, 56, 34, 76, 23, 98, 43, 56, 23]
    print(unsort_array)

    sorted_array = bubble_sort(unsort_array)
    print(sorted_array)

    pass
